package keke;

import java.util.Scanner;

class ArrayUtils{
	static class PairResult{
		private double min;
		private double max;
		
		public double getMin() {
			return min;
		}

		public void setMin(double min) {
			this.min = min;
		}

		public double getMax() {
			return max;
		}

		public void setMax(double max) {
			this.max = max;
		}

		@Override
		public String toString() {
			return "PairResult [min=" + min + ", max=" + max + "]";
		}
		
	}
	static PairResult findMinMax(double[] values){
		PairResult pairresult = new PairResult();
		if(values==null)
			return pairresult;
		double max=values[0];
		double min=values[0];
		for(int i=0;i<values.length;i++){
			if(values[i]>max)
				max=values[i];
			if(values[i]<min)
				min=values[i];
		}
		pairresult.setMax(max);
		pairresult.setMin(min);
		return pairresult;
	}
}
public class Main0404 {
	public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        double[] value=new double[n];
        for(int i=0;i<n;i++){
        	value[i]=in.nextDouble();
        }
        System.out.println(ArrayUtils.findMinMax(value));
        System.out.println(ArrayUtils.PairResult.class);
	}
}
